#ifndef YT_WEB_H
#define YT_WEB_H

#include <QtCore>
#include <QtWebKit>

#include "yt_rec.h"

class T_VideoList;

class YtWeb : public QObject
{
    Q_OBJECT
private:
    QWebView *m_webview;
public:
    YtWeb(QWebView *a_webview);
	static bool getFileForVideoIcon(QString a_id, QFile &a_file);
	static QString getUrlForVideoIcon(QString a_id);
    void initPage(QWebView *a_webview, QWebElement *a_webelem);
    QUrl stripUrlPercentEncoding(const QUrl &a_url);
	void pageVideoPlay(QWebElement *a_webelem, QString a_id, T_VideoList *a_recList);
public slots:
    void populateJavaScriptWindowObject();
public: signals:
	void answer_vlc_player(QString a_target, QString a_title);
	void answer_yt_player(QString a_id, QString a_title);
};

#endif // YT_WEB_H
